#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>

int Func(int n)
{
	int sum = 0;
	int a = n;
	for (int i = 0; i < 5; i++)
	{
		sum += a;
		a = a * 10 + n;
	}
	return sum;
}
int main()
{
	int n = 0;
	scanf("%d", &n);
	int r = Func(n);
	printf("%d", r);
	return 0;
}